#include "shell.h"
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "dht11.h"

extern int shell_getdht(void);

// 通过串口读取温湿度进行调试
int cmd_read_dht(int argc,char* argv[])
{
    bool result = shell_getdht();
    if(result)
    {
        shellPrint(shellGetCurrent(),"result: read err");
    }
    shellPrint(shellGetCurrent(), "currently:\r\nhumidity: +%.2f RH    temperature: +%.2f°", 
    WS_DHT->humidity, WS_DHT->temperature);

    return 0;
}

SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_WAIN),dht11,shell_getdht,read dht11 conmand);
